﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Protegidos/Administracao/GENTE_Adm.master" AutoEventWireup="true" CodeFile="acCadGrupoEmail.aspx.cs" Inherits="Protegidos_Administracao_Cadastros_acCadGrupoEmail" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %>

<asp:Content ID="Content2" ContentPlaceHolderID="cphSubConteudo" Runat="Server">

<telerik:RadCodeBlock ID="RadCodeBlock1" runat="server">
<script type="text/javascript">

    function ShowInsertForm() {
        window.radopen("_popup/acpPesqEmail.aspx", "RadWindow1");
        return false;
    }
    function refreshGrid() {
        $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("RebindAndNavigate");
    }
</script>
</telerik:RadCodeBlock>    

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" OnAjaxRequest="RadAjaxManager1_AjaxRequest">
<AjaxSettings>
    <telerik:AjaxSetting AjaxControlID="RadAjaxManager1">
        <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
        </UpdatedControls>
    </telerik:AjaxSetting>      
    <telerik:AjaxSetting AjaxControlID="RadGrid1">
        <UpdatedControls>
            <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1" />
        </UpdatedControls>
    </telerik:AjaxSetting>                                                             
</AjaxSettings>
</telerik:RadAjaxManager>

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Skin="Telerik" >
</telerik:RadAjaxLoadingPanel> 

<telerik:RadWindowManager ID="RadWindowManager2" runat="server">
    <Windows>
        <telerik:RadWindow  ID="RadWindow1" runat="server" Title="Adicionar Email" Height="500px"
            Width="700px" Left="400px" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true"   />
    </Windows>
</telerik:RadWindowManager>

<table width="99%" align="center">
    <tr>
        <td>
              
            <div class="Titulo01">Grupos de Email</div>
            <div class="Titulo02">Cadastros / Gerais / Contratos</div>

        </td>    
    </tr>
    <tr>
        <td>
        
            <table width="99%" align="right">
                <tr>
                    <td>
                        <div class="SuTituloVR">Dados Principais</div>
                    </td>
                </tr>
                <tr>
                    <td>
                        
                        <table width="100%" align="right" class="textoCZ_12" > 
                            <tr runat="server" id="tr4">
                                <td style="width: 180px">Patricinador / Prestador:</td>
                                <td>
                                    <telerik:RadComboBox ID="rcbOrgan" runat="server" Skin="Telerik" Width="322px" EmptyMessage="Selecione" AllowCustomText="true">
                                        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
                                    </telerik:RadComboBox>
                                    <input runat="server" id="hdId" type="hidden" value="1" />
                                    <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator1" ControlToValidate="rcbOrgan"
                                        InitialValue="" ErrorMessage="* obrigatório" ValidationGroup="1" />
                                </td>
                            </tr>
                            <tr runat="server" id="trRazaoSocial">
                                <td style="width: 150px">Nome do Grupo:</td>
                                <td>
                                    <asp:TextBox ID="txtNomeGrupo" runat="server" Width="320px"></asp:TextBox>
                                    <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator2" ControlToValidate="txtNomeGrupo"
                                        InitialValue="" ErrorMessage="* obrigatório" ValidationGroup="1" />
                                </td>
                            </tr>
                            <tr runat="server" id="tr1">
                                <td style="width: 150px">Status:</td>
                                <td>
                                    <telerik:RadComboBox ID="rcbStatus" runat="server" Skin="Telerik" Width="240px" EmptyMessage="Selecione" AllowCustomText="true">
                                        <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>
                                    </telerik:RadComboBox>
                                    <asp:RequiredFieldValidator runat="server" ID="RequiredFieldValidator3" ControlToValidate="rcbStatus"
                                        InitialValue="" ErrorMessage="* obrigatório" ValidationGroup="1" />
                                </td>
                            </tr>
                        </table>
                        
                    </td>
                </tr>
                
                <tr>
                    <td>
                        <div class="SuTituloVR">Componente(s)</div>
                    </td>
                </tr>
                <tr>
                    <td>
                        
                        <!-- INICIO - GRID Gestor-->
                        <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" Width="100%" ondeletecommand="RadGrid1_DeleteCommand" Skin="Telerik">
                            <PagerStyle Mode="NumericPages" />
                            <MasterTableView AutoGenerateColumns="False" DataKeyNames="IdPessoaEmail" ClientDataKeyNames="IdPessoaEmail" Width="100%" CommandItemDisplay="Top" PageSize="10">
                                <Columns>
                                    <telerik:GridBoundColumn DataField="Pessoa.NomeCompleto" HeaderText="Pessoa.NomeCompleto" SortExpression="Pessoa.NomeCompleto" UniqueName="Pessoa.NomeCompleto"></telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Email" HeaderText="Email" SortExpression="Email" UniqueName="Email"></telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="TipoEmail.Descricao" HeaderText="TipoEmail.Descricao" SortExpression="TipoEmail.Descricao" UniqueName="TipoEmail.Descricao"></telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="Status.Descricao" HeaderText="Status.Descricao" SortExpression="Status.Descricao" UniqueName="Status.Descricao"></telerik:GridBoundColumn>
                                    <telerik:GridButtonColumn UniqueName="DeleteColumn" Text="Remover" CommandName="Delete" ItemStyle-HorizontalAlign="Left" HeaderStyle-HorizontalAlign="Left" HeaderStyle-Width="60px"></telerik:GridButtonColumn>
                                </Columns>
                                <CommandItemTemplate>
                                    <!-- -->
                                    <table border="0" style="width: 100%;" class="rgCommandTable">
	                                    <tbody>
	                                        <tr>
		                                        <td align="left">
		                                            <input class="rgAdd" type="button" title=" Adicionar Gestor" onclick="return ShowInsertForm();" />
                                                    <a href="#" onclick="return ShowInsertForm();">Adicionar E-mail</a>
		                                        </td>
	                                        </tr>
                                        </tbody>
                                    </table>
                                    <!-- -->
                                </CommandItemTemplate>
                            </MasterTableView>
                        </telerik:RadGrid>
                        
                        <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
                            <Windows>
                                <telerik:RadWindow  ID="SelectGestor" runat="server" Title="Adicionar Gestor" Height="400px"
                                    Width="500px" Left="400px" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true"   />
                                <telerik:RadWindow  ID="InsertFile" runat="server" Title="Upload de arquivo" Height="400px"
                                    Width="500px" Left="400px" ReloadOnShow="true" ShowContentDuringLoad="false" Modal="true"   />
                            </Windows>
                        </telerik:RadWindowManager>
                        <!-- FIM - Grid Gestor -->
                        
                    </td>
                </tr>
                <tr>
                    <td align="right">
                    
                    <table>
                        <tr runat="server" id="tr5">
                            <td style="width: 400px">
                                <asp:Label ID="lblResultado" runat="server" Text=""></asp:Label>
                            </td>
                            <td style="width: 250px">
                                <asp:Button ID="btnGravar" runat="server" Text="Gravar" Width="110px" ValidationGroup="1" onclick="btnGravar_Click" />&nbsp;&nbsp;
                                <asp:Button ID="btnLimpar" runat="server" Text="Limpar" Width="110px" onclick="btnLimpar_Click" />
                            </td>
                        </tr>
                    </table>
                        
                    </td>
                </tr>
                <tr>
                    <td align="right">
                    <br />
                        <a href="acGrupoEmail.aspx">Voltar</a>
                    </td>
                </tr>
            </table>
                            
        </td>    
    </tr>        
    
</table>    


</asp:Content>

